package com.ict.web.service;


import com.baomidou.mybatisplus.extension.service.IService;
import com.ict.web.domain.Approval;
import com.ict.web.domain.ProjectManagement;
import com.ict.web.dto.ApprovalAddDto;
import com.ict.web.vo.ApprovalVo;
import com.ict.web.vo.OnLineVo;
import org.apache.ibatis.annotations.Param;

import java.time.LocalDateTime;
import java.util.List;

/**
 * 审核Service接口
 *
 * @author ruoyi
 * @date 2022-02-24
 */
public interface IApprovalService extends IService<Approval>
{
    /**
     * 大数据局查询项目审核列表
     * @param proId
     * @return
     */
    public List<ApprovalVo> selectProjectApprovalList(Long proId);

    /**
     * 新增审核对象
     * @param dto
     * @return
     */
    public boolean insertApproval(ApprovalAddDto dto);
    /**
     * 在线预审
     * @param proId
     * @param createTime
     * @return
     */
    public List<OnLineVo> onLinePreliminary(Long proId,String createTime);

    /**
     * 年度计划审核记录
     * @param projectId
     * @return
     */
    public Approval plan(Long projectId);
    /**
     * 处理审核记录
     * @param proId 项目id
     *@param status 待处理的审核状态对应status
     * @param approvalStatus 处理的审核状态对应status
     * @param approvalDatabase 资料库（文件的Url地址）
     *@param expertId 专家id
     *@param planId 年度计划id
     *@param approvalOperator 操作人
     * @return
     */
    public Approval dealStayApproval(Long proId, String status, String approvalStatus, String approvalDatabase, Long expertId, Long planId, String approvalOperator);

    /**
     * 查询审核记录
     * @param proId
     * @param approvalStatus
     * @param expertId
     * @param planId
     * @return
     */
    public Approval getApproval(Long proId, String approvalStatus,Long expertId, Long planId);
    /**
     * 批量插入审核进程
     * @param list
     * @return
     */
    public int batchApproval(List<Approval> list);

    /**
     * 根据审核进程Id获取前一个进程的审批意见
     * @param approvalId
     * @return
     */
    public String getApprovalOpinion(Long approvalId);

    String lastApprovalResult(String expertId);
    /**
     * 查询最新一条审核记录
     * @param proId
     * @param approvalStatus
     * @param expertId
     * @param approvalType
     * @param createTime
     * @return
     */
    public Approval getApprovalByCreateTime(@Param("proId") Long proId, @Param("approvalStatus")String approvalStatus,
                                            @Param("expertId")Long expertId, @Param("approvalType")String approvalType
            , @Param("createTime") LocalDateTime createTime);
    /**
     *同步项目数据到项目信息表中
     * @param projectManagement
     */
    public void synchronizationProjectInfo(ProjectManagement projectManagement);
}
